﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace JasLib.Interop.Win32
{
    public static partial class URLMON
    {
        [DllImport(Constants.ModuleNames.URLMON, EntryPoint = "CoInternetSetFeatureEnabled", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
        public static extern HRESULT CoInternetSetFeatureEnabled(INTERNETFEATURELIST FeatureEntry, CoInternetSetFeatureCode dwFlags, bool fEnable);

        [DllImport(Constants.ModuleNames.URLMON, EntryPoint = "CoInternetIsFeatureEnabled", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
        public static extern HRESULT CoInternetIsFeatureEnabled(INTERNETFEATURELIST FeatureEntry, CoInternetGetFeatureCode dwFlags);

        [DllImport(Constants.ModuleNames.URLMON, EntryPoint = "CoInternetIsFeatureEnabledForUrl", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
        public static extern HRESULT CoInternetIsFeatureEnabledForUrl(
            INTERNETFEATURELIST FeatureEntry,
            CoInternetGetFeatureCode dwFlags,
            string szURL,
            IInternetSecurityManager pSecMgr);

        [DllImport(Constants.ModuleNames.URLMON, EntryPoint = "CoInternetIsFeatureEnabledForIUri", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
        public static extern HRESULT CoInternetIsFeatureEnabledForIUri(
            INTERNETFEATURELIST FeatureEntry,
            CoInternetGetFeatureCode dwFlags,
            IUri pIUri,
            IInternetSecurityManagerEx2 pSecMgr);

        [DllImport(Constants.ModuleNames.URLMON, EntryPoint = "CoInternetIsFeatureZoneElevationEnabled", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
        public static extern HRESULT CoInternetIsFeatureZoneElevationEnabled(
            string szFromURL,
            string szToURL,
            IInternetSecurityManager pSecMgr,
            CoInternetGetFeatureCode dwFlags);

        [DllImport(Constants.ModuleNames.URLMON, EntryPoint = "CreateUri", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.Winapi)]
        public static extern HRESULT CreateUri(
            string pwzURI,
            Uri_CREATE dwFlags,
            UIntPtr dwReserved,   // must be 0
            out IUri ppURI);
    }
}